package com.abapi.pay.admin.controller;

import com.abapi.pay.admin.support.db.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * @Author ldx
 * @Date 2020/2/1 16:51
 * @Description
 * @Version 1.0.0
 */
@Controller
@RequestMapping("/")
public class IndexController {

    @Autowired
    private IndexService indexService;

    @RequestMapping("/")
    public String index(Model model){
        System.out.println("----index-------");
        return "index";
    }

    @RequestMapping("/welcome")
    public String welcome(Model model){
        System.out.println("----welcome-------");
        Map<String,Object> map = indexService.indexData();
        model.addAttribute("indexData",map);
        return "welcome";
    }

}
